﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="add_user.aspx.cs" Inherits="Setting_add_user" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
     <title>添加用户</title>
    <link href="../Styles/Site.css" rel="stylesheet" type="text/css" />
    <script src="../Scripts/jquery-1.5.1.min.js" type="text/javascript"></script>
	 <script type="text/javascript">

	 	function VerifyForm() {
	 		if ($("#userName").val() == "") {
	 			alert('名称不能为空!');
	 			return false;
	 		}
	 		if ($("#userpwd").val() == "") {
	 			alert('密码不能为空!');
	 			return false;
	 		}
	 		if ($("#userpwd").val() != $("#userpwd2").val()) {
	 			alert('二次输入的密码不同!');
	 			return false;
	 		}
	 		if ($("#emplID").val() == "") {
	 			alert('请选择对应人员!');
	 			return false;
	 		}
	 		return true;
	 	}
	 	function doSave() {
	 		if (VerifyForm()) {
	 			form1.submit();
	 		}
	 	}
	 	function chooseEmpl() {
	 		window.open('dlg_user.aspx?selmode=1', '', 'width=400px,height=400px,scrollbars=1,resizable=no,left=' + (screen.availWidth - 400) / 2 + ',top=' + (screen.availHeight - 400) / 2);
	 	}
	 	function recvSelectUser(selNodes) {
	 		if (selNodes != null && typeof (selNodes) != 'undefined') {
	 			$.map(selNodes, function (node) {
	 				$("#emplID").val(node.data.key);
	 				$("#emplName").val(node.data.title);
	 			});
	 		}
	 	}
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="editFormTitle">添加用户</div>
	<div >
	 <table id="EmplInfo" border="0" cellpadding="3">
		<tr><td  >名称</td><td><input type="text" id="userName" name="userName" style="width:200px;" value="" /><font color="red">*</font></td></tr>	
		<tr><td  >密码</td><td><input type="password" id="userpwd" name="userpwd" style="width: 200px;" value="" /><font color="red">*</font>
			</td>
		</tr>	
		<tr><td  >重复密码</td><td>
				<input type="password" id="userpwd2" name="userpwd2" style="width: 200px;" value="" /><font color="red">*</font>
			</td></tr>	
		<tr><td  >对应人员</td><td>
				<input type="text" id="emplName" name="emplName" readonly style="width: 200px;" value="" /><input type="hidden" id="emplID" name="emplID" /><input type="button" value="..." onclick="chooseEmpl()" /><font color="red">*</font>
			</td></tr>	
		
	 </table>
	 </div>
	 <div class="editFormBottom"><input type="button" value="  保存  " onclick="doSave()" />&nbsp;<input type="button" value=" 取消 " onclick="self.close()" /><span id="tipSpan"><%=tip %></span></div>
    </form>
</body>
</html>
